[PATCH] Fix building against the system portaudio library
authorAntonio Ospite <ao2@ao2.it>
Tue, 7 Nov 2017 12:06:33 +0000 (13:06 +0100)
committerJames Cowgill <jcowgill@debian.org>
Wed, 6 Jun 2018 10:55:07 +0000 (11:55 +0100)
commit46a3731950b3f36fededf2798ddb117d50c6e036
treefd48ef94a0152f9352b7153da5850dab9c3288de
parentace836eee0c15ce5de73e63cc099f49d49901553
[PATCH] Fix building against the system portaudio library

Building against the system portaudio results in this error:

./src/AudioIO.cpp:983: undefined reference to `PaUtil_GetTime'
audacity-AudioIO.o: In function `audacityAudioCallback(void const*, void*,
unsigned long, PaStreamCallbackTimeInfo const*, unsigned long, void*)':
./src/AudioIO.cpp:4630: undefined reference to `PaUtil_GetTime'
collect2: error: ld returned 1 exit status
Makefile:2349: recipe for target 'audacity' failed
make[3]: *** [audacity] Error 1

This is because PaUtil_GetTime is declared as a C symbol in pa_util.h
but is resolved as a C++ symbol at link time.

Audacity fixes this in the local tree with this change:
https://github.com/audacity/audacity/commit/38fd97b8e26060332ab3e9e000a8882326a70ba7

However this is not general enough for the portaudio debian package.

Since PaUtil_GetTime() is the only function causing problems, just copy
over the code where it's used.

Gbp-Pq: Name 0005-Fix-building-against-the-system-portaudio-library.patch
src/AudioIO.cpp